home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / castools.zip / FUNC11H.ASM < prev    next >
Assembly Source File  |  1990-01-05  |  2KB  |  58 lines

  1. Include multi.inc
  2. Include model.inc
  3.  
  4. ;==============================================================================
  5. ;
  6. ;   CAS function 11h -- Get Queue Status
  7. ;
  8. ;   Format:
  9. ;               int CASGetQueueStatus (BYTE queue, QSTAT far *buffer)
  10. ;   Input:
  11. ;               pointer to queue status structure
  12. ;   Output:
  13. ;               Returns 0 if successful or negative error code,
  14. ;               fills queue status structure.
  15. ;==============================================================================
  16.  
  17.                 .CODE
  18. CASGetQueueStatus       PROC    arg1:BYTE, arg2:PTR WORD
  19.  
  20.                 push    es              ; save registers
  21.                 push    di
  22.                 push    bx
  23.                 push    cx
  24.  
  25.                 mov     ax,MUX          ; load multiplex number
  26.                 mov     ah,al           ; move into ah
  27.                 mov     al,11h          ; CAS function 11
  28.                 mov     dl,arg1         ; load queue
  29.                 int     2Fh
  30.                 cmp     ax,0            ; call successful?
  31.                 jl      ERR             ; call failed
  32.  
  33.         IF      @DataSize               ; large and compact models
  34.                 les     di,arg2         ; pointer to data block
  35.                 mov     es:[di],ax      ; number of changes
  36.                 mov     es:[di+2],bx    ; number of control files
  37.                 mov     es:[di+4],cx    ; number of received files
  38.         ELSE
  39.                 mov     di,arg2         ; small and medium model
  40.                 mov     [di],ax         ; number of changes
  41.                 mov     [di+2],bx       ; number of control files
  42.                 mov     [di+4],cx       ; number of received files
  43.         ENDIF
  44.                 cmp     ax,0
  45.                 jle     ERR             ; don't modify error code
  46.                 mov     ax,0            ; return success value
  47.  
  48. ERR:
  49.                 pop     cx              ; restore registers
  50.                 pop     bx
  51.                 pop     di
  52.                 pop     es
  53.                 ret
  54. CASGetQueueStatus       endp
  55.  
  56.                 END
  57.  
  58.